aaboe - Technical Training - #1385
Conversation
This comment was marked as outdated.
This comment was marked as outdated.
7b76000 to
1e00b25
Compare
1e00b25 to
44209f1
Compare
| <field name="model">estate.property</field> | ||
| <field name="arch" type="xml"> | ||
| <list string="Properties"> | ||
| <field name="name" string="Title" class="text-center" width="50px"/> |
There was a problem hiding this comment.
Although this works fine, you don't have to set a string for the same field in each XML view. It is a better practice to identify the name of the field in the field definition in the python file
|
|
||
| </menuitem> | ||
| </data> | ||
| </odoo> No newline at end of file |
There was a problem hiding this comment.
It is mandatory to have newline at the end of each file
| @@ -0,0 +1,98 @@ | |||
| <?xml version="1.0" ?> | |||
There was a problem hiding this comment.
I am not sure why do we need this file. We can add those views in the same file as the action. So having it in estate_property_views.xml is the right place I would say
There was a problem hiding this comment.
I thought would be nice to isolate things a bit, but you are right not worth it since it is not going to be that big anyway..
Thank you will merge these togther
Thank you @yoba-odoo for the feedback I will be addressing it shortly |
b65819c to
fcaabc1
Compare
c26e05a to
228b386
Compare
f979424 to
a33c67f
Compare
| date_availability = fields.Date(string='Available From', copy=False, default=DEFAULT_AVAILABILITY_DATE) | ||
|
|
||
| expected_price = fields.Float(required=True) | ||
| _check_expected_price = models.Constraint('check(expected_price > 0)', 'Expected Price must be greater than 0') |
There was a problem hiding this comment.
The constraints are usually defined after we define all fields
| _order = 'price desc' | ||
|
|
||
| price = fields.Float() | ||
| _check_price = models.Constraint('check(price > 0)', 'Price must be greater than 0') |
| <field name="date_deadline"/> | ||
| <button name="action_accept" type="object" icon="fa-check" title="Accept" invisible="status"/> | ||
| <button name="action_refuse" type="object" icon="fa-times" title="Refuse" invisible="status"/> | ||
| <field name="status" column_invisible="True"/> <!-- Used by list decorations and Accept/Refuse buttons --> |
There was a problem hiding this comment.
This was how we do it in older versions but currently we can remove this field as when parsing the view the framework itself creates a field for it to use. So you don't have to define a field tag just to use it in a condition or decoration.
| <field name="expected_price" class="text-center" width="50px"/> | ||
| <field name="selling_price" class="text-center" width="50px"/> | ||
| <field name="date_availability" class="text-center" width="50px" optional="hide"/> | ||
| <field name="state" column_invisible="True"/> <!-- Used by list decorations --> |
| 'views/estate_property_tags_views.xml', | ||
| 'views/res_users_views.xml', | ||
| 'views/estate_menus.xml', | ||
| 'security/ir.model.access.csv', |
There was a problem hiding this comment.
Security file always have to come first, as this is the order in which the files will be loaded and security is important to be there when loading other files
|
Thank you for the review and feedback, @yoba-odoo |
No description provided.